﻿//摄像头跟踪
var cameraTrackControls;

var page = {
    initialStatus: function (type) {
        viewer.shadows = false;
        $(".flybottomTwo .progressFinger").stop(true).animate({ left: "9px" });
        if (type != "fly") {
            //停止当前飞行
            cameraTrackControls.stop();
            //清空当行飞行
            cameraTrackControls.clear();
        }
        //日照分析
        $("#timeGet").removeClass("active");
        //隐藏所有左边菜单的弹出控制层
        $("#codeCall,#setting-container,#SplitScreen-container,#VolumeAnalysis-container,#viewAnalysis-container,#thum-container,#flyBotttom,#flyPogress,#measure-container,#info,#serverCall,#translate-container,.analysis").hide();
    },
    init: function () {
        var datas = "guid=" + dataGuid;
        var url = sBasePath + "/TX_SceneManager/scene/querySceneByGUID.action";
        $.ajax(
        {
            url: url,
            type: "post",
            data: datas,
            async: false,
            dataType: "Json",
            success: function (result) {
                if (result.resultCode == "1") {
                    $("#sceneTitle,#infoTitle").html(result.scene.title);
                    $("title").html(result.scene.title + "-九尚科技场景预览")
                    $("#viewTimes").html(result.scene.viewTimes);
                    if (result.scene.viewpointGuid) {
                    } else {
                        $("#back-position").remove();
                    }
                    $("#infoTime").html(result.scene.addTime);
                    var sKeyWord = result.scene.keyword;
                    if (sKeyWord) {
                        var sTagArr = sKeyWord.slice(1, sKeyWord.length).split(",");
                        var sTagAddHtml = "";
                        for (var a = 0; a < sTagArr.length; a++) {
                            sTagAddHtml += "<a><span>" + sTagArr[a] + "</span></a>"
                        }
                        $("#infoTags").html(sTagAddHtml);
                    }
                    var description = result.scene.descript;
                    if (description) {
                        $("#infoDes").html(description);
                    } else {
                        $("#infoDes").parents(".infoItem").hide();
                    }
                } else {
                    console.error(result.resultMsg);
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                $('body').dailog({ type: 'danger', bottons: ['确定'], discription: "获取场景信息失败" });
            }
        });
    }
}


$(function () {
    var maskTimer = setTimeout(function () {
        $("#switch-box,.sceneVedio,.flagTile,.flagimg").show();
    }, 1500);

});